<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Inventory Movement</title>
    </h:head>
      <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
    <f:view beforePhase="#{InventoryMovementManagedBean.initView}">
    <h:body>
        <h:form prependId="false">
             <p:growl id="growl" showDetail="true" />  
                <p:growl id="notif" showDetail="true"/>  
                    <p:poll interval="5"   
                            actionListener="#{MessageManagedBean.checkNewMessage}" immediate="true" update="notif" />
            <div id="top" class="top">
                <h:graphicImage value="/image/newHeader.jpg"/>
            </div>
            <div id="content" >
             
                <table >
                    <tr><td>
                        <p:toolbar style="background-color:darkred;font-size:70%;height:25px;width:100%"> 
                            <p:toolbarGroup align="right">
                                <p:button title="Home" image="ui-icon-home" outcome ="InventoryDeptWorkspace"/>                                  
                                <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>                                    
                                 <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>                                   
                                <p:button title="Edit Preferences" image="ui-icon-gear"/>                                   
                                <p:button title="Help" image="ui-icon-help"/>
                                  <p:commandButton title="Log Out" immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                            </p:toolbarGroup>
                        </p:toolbar></td>
                        <td>
                              <h:graphicImage value="materials.png" style="width:35px;height:35px" />
                            <h:outputText value="         "/>
                            <h:outputText value="Inventory Movement" style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                            <p:spacer width="100" height="10"/>
                        </td>
                    </tr>
                    <tr>
                           
                        <td style="vertical-align:top">
                            <p:menu style="width:200px;font-size: 12px;font-family: Tahoma;border-style: ridge">  
                                <p:submenu label="Inventories" > 
                                    <p:menuitem value="New Product" url="http://localhost:8080/MerlionERP-war/SCM/addProduct.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>  
                                    <p:menuitem value="View All Products" url="http://localhost:8080/MerlionERP-war/SCM/products.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>  
                                    <p:menuitem value="New Material" url="http://localhost:8080/MerlionERP-war/SCM/addMaterial.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>                                      
                                    <p:menuitem value="View All Materials" url="http://localhost:8080/MerlionERP-war/SCM/materials.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                    <p:menuitem value="View Unhoused Inventories" url="http://localhost:8080/MerlionERP-war/SCM/unhousedInventories.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                    <p:menuitem value="View Inventory Movements" url="http://localhost:8080/MerlionERP-war/SCM/inventoryMovements.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                </p:submenu>
                                <p:submenu label="Warehouses" >
                                    <p:menuitem value="New Warehouse" url="http://localhost:8080/MerlionERP-war/SCM/addWarehouse.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>        
                                    <p:menuitem value= "View All Warehouses" url="http://localhost:8080/MerlionERP-war/SCM/warehouses.xhtml" ajax="false" icon="ui-icon ui-icon-tag" />
                                 
                                </p:submenu>
                                <p:submenu label="Shipments and Orders">
                                    <p:menuitem value="Delivery Orders" url="http://localhost:8080/MerlionERP-war/SCM/deliveryOrders.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>
                                    <p:menuitem value="Picking Orders" url="http://localhost:8080/MerlionERP-war/SCM/pickingOrders.xhtml" ajax="false" icon="ui-icon ui-icon-tag"/>            
                                </p:submenu>
                            </p:menu>
                            <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                        </td>
                        
                        <td style="vertical-align:top">
                          
                            <p:toolbar style="background-color:  #d9bb73;font-size: 11px;width:99.5%"> 
                                <p:toolbarGroup align="left">  
                       
                                </p:toolbarGroup>  
                            </p:toolbar> 

                            <p:dataTable id="panel" 
                                         var="inv" value="#{InventoryMovementManagedBean.invStateList}"                       
                                         paginator="true" rows="10"  
                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                     
                                         rowsPerPageTemplate="10,20,30"  style="font-size:70%;width:100%"
                                    
                                         emptyMessage="No data found with given criteria" widgetVar="movementTable">  
                                
                               <f:facet name="header">                           
                                    <p:outputPanel style="text-align:right"  >
                                        <h:outputText value="Search all fields:" style="margin-left:840px" />  
                                        <p:inputText id="globalFilter" onkeyup="movementTable.filter()" style="right:-100px;width:150px" />  
                                    </p:outputPanel>
                                </f:facet> 
                                
                               
  
    
                                <!--Product ID-->
                                <p:column sortBy="#{inv.itemId}" filterBy="#{inv.itemId}" filterMatchMode="contains"
                                          filterStyle="width:50px">
                                          <!--style="border-left-color:transparent;border-right-color:transparent">-->
                                    <f:facet name="header">
                                        <h:outputText value="ID"/>
                                    </f:facet>
                                    <h:outputText value="#{inv.itemId}"/>
                                </p:column>
                                
                                <!--Product Name-->
                                 <p:column headerText="Item Name" sortBy="#{inv.itemName}" filterBy="#{inv.itemName}" filterMatchMode="contains"
                                           filterStyle="width:150px">
           
                                            <h:outputText value="#{inv.itemName}" />  
                
                                </p:column>   
                                
                                <!--Description-->
                                <p:column headerText="Quantity" sortBy="#{inv.qty}" 
                                          filterBy="#{inv.qty}" filterMatchMode="contains"
                                          filterStyle="width:100px"> 
       
                                        <h:outputText value="#{inv.qty}" />  
             
                                </p:column>  

                                
                                <!--In hand Quantity-->
                                <p:column headerText="Direction" sortBy="#{inv.direction}" 
                                          style="width:150px" filterBy="#{inv.direction}" filterMatchMode="contains">
             
                                        <h:outputText value="#{inv.direction}" />  
                     
                                </p:column>  

                                 <p:column headerText="Warehouse ID" sortBy="#{inv.warehouseId}" 
                                          filterBy="#{inv.warehouseId}" filterMatchMode="contains">
             
                                        <h:outputText value="#{inv.warehouseId}" />  
                     
                                </p:column>  
                                
                                    <p:column headerText="Warehouse Name" sortBy="#{inv.warehouseName}" 
                                          style="width:150px" filterBy="#{inv.warehouseName}" filterMatchMode="contains">
             
                                        <h:outputText value="#{inv.warehouseName}" />  
                     
                                </p:column>  
                                
                                    <p:column headerText="Movement Date" sortBy="#{inv.movementDate}" 
                                          filterBy="#{inv.movementDate}" filterMatchMode="contains">
             
                                        <h:outputText value="#{inv.movementDate}" />  
                     
                                </p:column>  
                      
                               
                              
                            </p:dataTable>  
                        </td></tr></table>  
                         
            </div>

            <div id="bottom" class="bottom">
                <h:graphicImage value="/image/merlionfooter.jpg"/>
            </div>
        </h:form>
    </h:body>
    </f:view>
     </f:view>
</html>

